<!DOCTYPE html>
<html>
<head>
<title>天气状况一览</title>
<!-- for-mobile-apps -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Weather Profile Widget Responsive web template, Bootstrap Web Templates, Flat Web Templates, Android Compatible web template, 
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyEricsson, Motorola web design" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false);
		function hideURLbar(){ window.scrollTo(0,1); } </script>
<!-- //for-mobile-apps -->
<!-- js -->
<script type="text/javascript" src="/static/js/jquery-2.1.4.min.js"></script>
<!-- //js -->
<!--skycons-icons-->
<script src="/static/js/skycons.js"></script>
<!--//skycons-icons-->
<link href="/static/css/style.css" rel="stylesheet" type="text/css" media="all" />
<link href='//fonts.googleapis.com/css?family=Josefin+Sans:400,100,100italic,300,300italic,400italic,600,600italic,700,700italic' rel='stylesheet' type='text/css'>
</head>
<body>
	<div class="main">
		<h1>天气  预览</h1>
		<div class="main-info">
			<div class="main-info-grid2">
				<h3><span></span> 浑源/大同</h3>
				<div class="main-info-grid2-info">
					<div class="main-info-grid2-infol">
					</div>
					<div class="main-info-grid2-infor">
					</div>
					<div class="clear"> </div>
					<p style="color:#fff; font-size:14px;margin-top:10px">注意：<span id="ganmao" ></span></p>
				</div>
				
				<div class="main-info-grid2-info-bottom">
				</div>
				<script>
						var icons = new Skycons({"color": "#fff"}),
							  list  = [
								"partly-cloudy-day"
							  ],
							  i;

						  for(i = list.length; i--; )
							icons.set(list[i], list[i]);
						  icons.play();
					</script>
					<script>
						
						  
						  function get_weather(weather_name){
							var day_type = 'clear-day';
							if(weather_name == '晴'){
								day_type = '36';
							}
							if(weather_name == '多云'){
								day_type = '33';
							}
							if(weather_name == '阴'){
								day_type = '19';
							}
							if(weather_name == '小雨'){
								day_type = '16';
							}
							return day_type;
						  }
						  function get_week(week_name){
							week_name_en = '周一';
							if(week_name == '星期一'){
								week_name_en = '周一';
							}
							if(week_name == '星期二'){
								week_name_en = '周二';
							}if(week_name == '星期三'){
								week_name_en = '周三';
							}if(week_name == '星期四'){
								week_name_en = '周四';
							}if(week_name == '星期五'){
								week_name_en = '周五';
							}if(week_name == '星期六'){
								week_name_en = '周六';
							}if(week_name == '星期日'){
								week_name_en = '周日';
							}
							return week_name_en;
						  }
						  function get_date(date_str){
							var ds = date_str.split('-');
							var new_str = ds[2]+ '/' + ds[1]
							return new_str; 
						  }
						  function get_wd(wd_str){
							return wd_str.replace('高温','').replace(' ','').replace('℃','°');
						  }
						  $(function(){
								 var icons = new Skycons({"color": "#212121"}),
								  list  = [
									"clear-day","partly-cloudy-night","rain","fog","snow","cloudy"
								  ],
								  i;

							  for(i = list.length; i--; )
								icons.set(list[i], list[i]);
							  icons.play();
						  
							$.post('/v1/api/weather/info',
									function(data){
										var da_list = data.data.forecast;
										var today_str1 = '<p>'+get_week(da_list[0].week)+'  '+get_date(da_list[0].ymd)+'</p><h4>'+get_wd(da_list[0].high)+'</h4>';
										$('.main-info-grid2-infol').html(today_str1);
										$('.main-info-grid2-infor').html('<img src="/static/images/weather_icon/'+get_weather(da_list[0].type)+'.png" wdith=48 height=48>' );
										$('#ganmao').text(data.data.ganmao);
										var wa_list = ''
										for (var i=1;i<da_list.length-4;i++){
											var day_type = get_weather(da_list[i].type);
											var w_str = '<ul><li>'+get_week(da_list[i].week)+'<span>'+get_date(da_list[i].ymd)+'</span></li><li>'+get_wd(da_list[i].high)+'  <img src="/static/images/weather_icon/'+get_weather(da_list[i].type)+'.png" wdith=20 height=20></li></ul>'
											wa_list += w_str;
									   }
									   
									   $('.main-info-grid2-info-bottom').html(wa_list);
								
								    })
						  })
					</script>

			</div>
			<div class="clear"> </div>
		</div>
		<div class="copyright">
			<p></p>
		</div>
	</div>
</body>
</html>